package org.dandsoft.blackbox.laboratory.tools.applications;

import org.dandsoft.blackbox.laboratory.tools.JCRMonitorStorage;
import org.dandsoft.blackbox.laboratory.tools.view.EnviromentStatePanel;

import javax.swing.*;
import java.awt.*;
import java.io.File;

/**
 * Created by IntelliJ IDEA.
 * User: dvilyuzhanin
 * Date: 02.04.2009 19:27:05
 */
public class EnviromentStateForm extends JFrame {

    private EnviromentStatePanel enviromentState;

    public EnviromentStateForm(JCRMonitorStorage storage) throws HeadlessException {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLayout(new BorderLayout());
        enviromentState = new EnviromentStatePanel();
        enviromentState.setStorage(storage);


        add(enviromentState, BorderLayout.CENTER);
        setSize(640, 480);
        setVisible(true);
    }


    public static void main(String[] args) throws Exception {
        File file = new File("e:/lighter");
        if (!file.exists()) {
            throw new RuntimeException("repository not found");
        }
        JCRMonitorStorage monitor = JCRMonitorStorage.createRepository(file.getAbsolutePath());
        EnviromentStateForm form = new EnviromentStateForm(monitor);

    }
}
